<template>
  <r-form ref="form" style="text-align: left; width: 40%; margin-left: 30%" :columns="formColumns" :submit="formSubmit" @submit="onFormSubmit" @change="onFormChange"></r-form>
</template>
<script>
import formColumns from '@/views/formColumn'
export default {
  data() {
    return {
      formColumns,
      formSubmit: { name: '审核', type: 'danger' }
    }
  },
  methods: {
    onFormSubmit(formData) {
      console.log(formData)
      this.$message({
        message: 'success',
        type: 'success'
      })
    },
    onFormChange(formData) {
      if (formData.delivery) {
        this.$refs['form'].formItemHiden('desc')
      } else {
        this.$refs['form'].formItemShow('desc')
      }
    }
  }
}
</script>
